package cn.yuanqiao.archive.appManager.mapper;

import cn.yuanqiao.archive.appManager.domain.YqdaTrees;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * treesMapper接口
 * 
 * @author 赵常飞
 * @date 2023-06-17
 */
public interface YqdaTreesMapper 
{
    /**
     * 查询trees
     * 
     * @param Id trees主键
     * @return trees
     */
    YqdaTrees selectYqdaTreesById(@Param("Id") Long Id, @Param("tableName") String tablename);

    /**
     * 查询trees列表
     * 
     * @param yqdaTrees trees
     * @return trees集合
     */
    List<YqdaTrees> selectYqdaTreesList(@Param("yqdaTrees") YqdaTrees yqdaTrees, @Param("tableName") String tablename);

    /**
     * 新增trees
     * 
     * @param yqdaTrees trees
     * @return 结果
     */
    int insertYqdaTrees(@Param("yqdaTrees") YqdaTrees yqdaTrees, @Param("tablename") String tablename);

    /**
     * 修改trees
     * 
     * @param yqdaTrees trees
     * @return 结果
     */
    int updateYqdaTrees(@Param("yqdaTrees") YqdaTrees yqdaTrees, @Param("tableName") String tablename);

    /**
     * 删除trees
     * 
     * @param Id trees主键
     * @return 结果
     */
    int deleteYqdaTreesById(Long Id, String tablename);

    /**
     * 批量删除trees
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    int deleteYqdaTreesByIds(@Param("ids") Long[] ids, @Param("tableName") String tablename);

    List<YqdaTrees> getTreeListTypet(String tablename);

    List<YqdaTrees> getchildrens(@Param("id")Long id, @Param("tableName")String tablename,@Param("whereSql")String whereSql);

    String getname(@Param("parentId") Long parentId, @Param("sql") String sql, @Param("tableName") String tableName);

    void updatebypidandsql(@Param("parentId")Long parentId, @Param("name") String name, @Param("sql") String sql, @Param("tablename")String tablename);

    int createTreeTable(@Param("tableName") String tableName);

    List<YqdaTrees> getAllTreeList(String tableName);

    List<Map<String, Object>> getroletreechildrenmap(@Param("tenantCode")String tenantCode);

    int createTreeroleTable(@Param("tableName")String tableName);

    List<Map<String, Object>> getmenutreechildrenmap(@Param("roleId")Long roleId, @Param("superId") Long superId);

    List<Map<String, Object>> getTreeListTypetrole(@Param("treetable")String treetable, @Param("treeroletable") String treeroletable, @Param("roleId") Long roleId, @Param("menuId") Long menuId, @Param("choosedsql")String choosedsql);

    List<Map<String, Object>> getchildrensrole(@Param("treeid")Long treeid, @Param("treetable") String treetable, @Param("treeroletable") String treeroletable, @Param("roleId") Long roleId, @Param("menuId") Long menuId, @Param("choosedsql")String choosedsql);

    int deleteroletree(@Param("treeroletable")String treeroletable, @Param("roleId") Long roleId, @Param("menuId") Long menuId);

    int insertroletree(@Param("treeroletable")String treeroletable, @Param("roleId") Long roleId, @Param("menuId") Long menuId, @Param("treeid") Long treeid);

    List<YqdaTrees> gettreesgetTreeListTypet(@Param("treetable")String treetable, @Param("treeroletable")String treeroletable, @Param("userid")Long userid, @Param("menuId") Long menuId);

    List<YqdaTrees> getchildrensbyrole(@Param("treetable")String treetable, @Param("treeroletable")String treeroletable, @Param("treeid") Long treeid, @Param("userid")Long userid, @Param("menuId") Long menuId,@Param("whereSql")String whereSql);

    List<Map<String, Object>> testsql(@Param("sql")String sql);

    void insertsql(@Param("sql")String sql);

    List<YqdaTrees> gettreesgetTreeListByPid(@Param("treetable")String treetable,@Param("treeroletable")String treeroletable, @Param("userid")Long userid,@Param("menuId") Long menuId,@Param("pId")Long pId, @Param("code")String code);



    List<YqdaTrees> getTreeListByPid(@Param("treetable")String tableName, @Param("pId")Long pId, @Param("code")String code);

    void updateFonds(@Param("fondsName") String fondsName,@Param("tableName") String tableName);
}
